import type { VbenFormSchema } from '#/adapter/form';

import { $t } from '#/locales';

export const schema: VbenFormSchema[] = [
  {
    component: 'Input',
    fieldName: 'id',
    dependencies: {
      triggerFields: [''],
      show: () => false,
    },
  },
  {
    component: 'Switch',
    fieldName: 'pointTradeDeductEnable',
    label: $t('views.member.config.pointTradeDeductEnable'),
    help: $t('views.member.config.pointTradeDeductEnableHelpMessage'),
  },
  {
    component: 'InputNumber',
    fieldName: 'pointTradeDeductUnitPrice',
    label: $t('views.member.config.pointTradeDeductUnitPrice'),
    help: $t('views.member.config.pointTradeDeductUnitPriceHelpMessage'),
    componentProps: {
      min: 0,
      precision: 2,
      class: 'w-full',
      placeholder: $t('views.member.config.pointTradeDeductUnitPricePlaceholder'),
    },
  },
  {
    component: 'InputNumber',
    fieldName: 'pointTradeDeductMaxPrice',
    label: $t('views.member.config.pointTradeDeductMaxPrice'),
    help: $t('views.member.config.pointTradeDeductMaxPriceHelpMessage'),
    componentProps: {
      min: 0,
      class: 'w-full',
      placeholder: $t('views.member.config.pointTradeDeductMaxPricePlaceholder'),
    },
  },
  {
    component: 'InputNumber',
    fieldName: 'pointTradeGivePoint',
    label: $t('views.member.config.pointTradeGivePoint'),
    help: $t('views.member.config.pointTradeGivePointHelpMessage'),
    componentProps: {
      min: 0,
      class: 'w-full',
      placeholder: $t('views.member.config.pointTradeGivePointPlaceholder'),
    },
  },
];
